import {observable,action} from 'mobx-miniprogram'
export const store = observable({
  shareVar1:1,
  shareVar2:2,
  // 声明计算属性sum (计算属性只读)，计算属性必须在前面加get
  get sum(){
    return this.shareVar1 + this.shareVar2;
  },

  updateShareVar1: action(function(e){
      this.shareVar1+=e;
  })
})